\hypertarget{class_mem_shared}{\section{Mem\+Shared类 参考}
\label{class_mem_shared}\index{Mem\+Shared@{Mem\+Shared}}
}


共享内存类  




{\ttfamily \#include $<$Mem\+Shared.\+h$>$}

类 Mem\+Shared 继承关系图\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_mem_shared}
\end{center}
\end{figure}
\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_mem_shared_a06ca87b7be34fedebb386510110ec1fb}{{\bfseries Mem\+Shared} (sint32 type)}\label{class_mem_shared_a06ca87b7be34fedebb386510110ec1fb}

\item 
virtual sint32 \hyperlink{class_mem_shared_a39df58e72b12e412fb8474bf5d8173e5}{open} (const char $\ast$name=N\+U\+L\+L, sint32 io\+Mode=I\+O\+\_\+\+M\+O\+D\+E\+\_\+\+I\+N\+V\+A\+L\+I\+D)
\begin{DoxyCompactList}\small\item\em 打开设备 \end{DoxyCompactList}\item 
virtual sint32 \hyperlink{class_mem_shared_a62a6cdc1ea9b5507139139fce086e84d}{close} ()
\begin{DoxyCompactList}\small\item\em 关闭设备 \end{DoxyCompactList}\item 
\hypertarget{class_mem_shared_a24e32fa286382d21e12ef622ea5a367f}{virtual sint32 {\bfseries read\+Data} (char $\ast$buf, sint32 count, sint32 timeout\+Ms=-\/1)}\label{class_mem_shared_a24e32fa286382d21e12ef622ea5a367f}

\item 
\hypertarget{class_mem_shared_ad36a54f833477a0d2c1e1a98fe20edd3}{virtual sint32 {\bfseries write\+Data} (const char $\ast$buf, sint32 count, sint32 timeout\+Ms=-\/1)}\label{class_mem_shared_ad36a54f833477a0d2c1e1a98fe20edd3}

\item 
\hypertarget{class_mem_shared_a9a1bfc1f7a6e018b0e2914edc3abb54d}{virtual sint32 {\bfseries set\+Attribute} (sint32 attr, sint32 value)}\label{class_mem_shared_a9a1bfc1f7a6e018b0e2914edc3abb54d}

\item 
\hypertarget{class_mem_shared_a0760e878cf3ec71cf268828ec38dc66e}{virtual sint32 {\bfseries get\+Attribute} (sint32 attr)}\label{class_mem_shared_a0760e878cf3ec71cf268828ec38dc66e}

\item 
\hypertarget{class_mem_shared_ad48f6b4ba4901887f92567b6c51f86ea}{void $\ast$ {\bfseries get\+Mem\+Addr} ()}\label{class_mem_shared_ad48f6b4ba4901887f92567b6c51f86ea}

\item 
void $\ast$ \hyperlink{class_mem_shared_ac68524a36e11ba51427c743e59cbb785}{attach} ()
\begin{DoxyCompactList}\small\item\em 创建并绑定共享内存 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_mem_shared_a08e6309ca41938d42aad149d7f8918e1}{detach} ()
\begin{DoxyCompactList}\small\item\em 销毁共享内存区域 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{额外继承的成员函数}


\subsection{详细描述}
共享内存类 

\subsection{成员函数说明}
\hypertarget{class_mem_shared_ac68524a36e11ba51427c743e59cbb785}{\index{Mem\+Shared@{Mem\+Shared}!attach@{attach}}
\index{attach@{attach}!Mem\+Shared@{Mem\+Shared}}
\subsubsection[{attach}]{\setlength{\rightskip}{0pt plus 5cm}void $\ast$ Mem\+Shared\+::attach (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_mem_shared_ac68524a36e11ba51427c743e59cbb785}


创建并绑定共享内存 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回内存地址,失败返回\+N\+U\+L\+L 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_mem_shared_a62a6cdc1ea9b5507139139fce086e84d}{\index{Mem\+Shared@{Mem\+Shared}!close@{close}}
\index{close@{close}!Mem\+Shared@{Mem\+Shared}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Mem\+Shared\+::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_mem_shared_a62a6cdc1ea9b5507139139fce086e84d}


关闭设备 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
设备关闭成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


重载 \hyperlink{class_i_o_device_a1120c9e7a7c4d0b23083effbe4cb6279}{I\+O\+Device} .

\hypertarget{class_mem_shared_a08e6309ca41938d42aad149d7f8918e1}{\index{Mem\+Shared@{Mem\+Shared}!detach@{detach}}
\index{detach@{detach}!Mem\+Shared@{Mem\+Shared}}
\subsubsection[{detach}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Mem\+Shared\+::detach (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_mem_shared_a08e6309ca41938d42aad149d7f8918e1}


销毁共享内存区域 


\begin{DoxyParams}{参数}
{\em none} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_mem_shared_a39df58e72b12e412fb8474bf5d8173e5}{\index{Mem\+Shared@{Mem\+Shared}!open@{open}}
\index{open@{open}!Mem\+Shared@{Mem\+Shared}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Mem\+Shared\+::open (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{dev\+Name = {\ttfamily NULL}, }
\item[{sint32}]{mode = {\ttfamily IO\+\_\+MODE\+\_\+INVALID}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_mem_shared_a39df58e72b12e412fb8474bf5d8173e5}


打开设备 


\begin{DoxyParams}{参数}
{\em dev\+Name} & 设备全名(包含路径,如\+:/dev/tty\+S0) \\
\hline
{\em mode} & 打开模式\+I\+O\+\_\+\+M\+O\+D\+E\+\_\+\+E \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
设备打开成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


重载 \hyperlink{class_i_o_device_a426aac91300f077d57b1f30c76c7c430}{I\+O\+Device} .



该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_mem_shared_8h}{Mem\+Shared.\+h}\item 
libemb/src/Mem\+Shared.\+cpp\end{DoxyCompactItemize}
